package com.zs.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.google.gson.Gson;
import com.zs.common.config.ResponseCode;
import com.zs.mapper.ProjectLogMapper;
import com.zs.model.ProjectLogEntity;
import com.zs.model.ResponseCodeEntity;
import com.zs.query.ProjectLogQuery;
import com.zs.service.ProjectLogService;

/**
 * 
 * @author THINK
 *
 */
@Service("projectLogService")
public class ProjectLogServiceImpl implements ProjectLogService {

    @Resource
    private ProjectLogMapper projectLogMapper;
    
    @Resource
    private Gson gson;

    @Override
    public String selectProjectLogList(ProjectLogQuery projectLogQuery) {
        List<ProjectLogEntity> projectLogList = projectLogMapper.selectProjectLogList(projectLogQuery);
        int recordCnt = projectLogMapper.selectProjectLogListCnt(projectLogQuery);

        return gson.toJson(new ResponseCodeEntity(ResponseCode.DATA_OK,ResponseCode.DATA_SUCESS,projectLogList,recordCnt,projectLogQuery.getBaseCriteria().getPageSize(),projectLogQuery.getBaseCriteria().getPageNo()));
    }
}
